package com.example.hyw.szysteam.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by HYW on 2018/6/4.
 */

public class CodeTypeCheckUtil {
    public static boolean isEmail(String strEmail){
        String strPattern="^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";
        Pattern pattern=Pattern.compile(strPattern);
        Matcher matcher=pattern.matcher(strEmail);
        return matcher.matches();
    }

    public static boolean passwordCheck(String strPsw){
        String strPattern="^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$";
        Pattern pattern=Pattern.compile(strPattern);
        Matcher matcher=pattern.matcher(strPsw);
        return matcher.matches();
    }
}
